package com.block.datapush.common.enums;


import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Getter
public enum FilterErrorEnum {

    CITY_ERROR("CITY_ERROR"),
    ZHIMA_ERROR("ZHIMA_ERROR"),
    BAITIAO_ERROR("BAITIAO_ERROR"),
    HUABEI_ERROR("HUABEI_ERROR"),
    AGE_ERROR("AGE_ERROR"),
    LOANAMOUNT_ERROR("LOANAMOUNT_ERROR"),
    XUELI_ERROR("XUELI_ERROR"),
    CHANNELCODE_ERROR("CHANNELCODE_ERROR"),
    IDCARD_ERROR("IDCARD_ERROR"),

    HOUSE_ERROR("HOUSE_ERROR"),
    CAR_ERROR("CAR_ERROR"),
    GJJ_ERROR("GJJ_ERROR"),
    SHEBAO_ERROR("SHEBAO_ERROR"),
    BAODAN_ERROR("BAODAN_ERROR"),
    YUQI_ERROR("YUQI_ERROR"),
    ENTERPRISEOWNER_ERROR("ENTERPRISEOWNER_ERROR"),

    ORFILTER_ERROR("ORFILTER_ERROR"),

    IN_CHANNLE_ERROR("IN_CHANNLE_ERROR"),
    OUT_CHANNLE_ERROR("OUT_CHANNLE_ERROR"),

    TIME_ERROR("TIME_ERROR"),
    PRICE_ERROR("PRICE_ERROR"),
    STATUS_ERROR("STATUS_ERROR"),
    DAYWEEK_ERROR("DAYWEEK_ERROR"),

    // 竞价失败
    FIGHT_PRICE_ERROR("FIGHT_PRICE_ERROR", "竞价失败"),
    PUSH_SUCCESS_ERROR("PUSH_SUCCESS_ERROR", "推送成功"),
    PUSH_FAILED_ERROR("PUSH_FAILED_ERROR", "推送失败"),
    ;

    static List<FilterErrorEnum> needHandleList = new ArrayList<>();
    static {
        needHandleList.contains(TIME_ERROR);
        needHandleList.contains(PRICE_ERROR);
        needHandleList.contains(STATUS_ERROR);
        needHandleList.contains(DAYWEEK_ERROR);
    }

    String result;
    String messsage;

    FilterErrorEnum(String result){
        this.result = result;
    }

    FilterErrorEnum(String result,String messsage){
        this.result = result;
        this.messsage = messsage;
    }

    public static boolean isNeedHandle(FilterErrorEnum filterErrorEnum){
        if (needHandleList.contains(filterErrorEnum)){
            return true;
        }
        return false;
    }
}
